//
//  LCComposeButton.swift
//  SinaWeiBo
//
//  Created by mac on 16/12/11.
//  Copyright © 2016年 heima. All rights reserved.
//

import UIKit

class LCComposeButton: UIButton {
    
    //重写isHighlighted方法,改变button的transfrom的时候不走layoutsbuviews的方法
    override var isHighlighted: Bool{
        get{
            return false
        }set{
            //空实现
        }
    }
    

    override func layoutSubviews() {
        super.layoutSubviews()
        //设置图片的宽高
        imageView?.wigth = wigth
        imageView?.height = wigth
        imageView?.y = 0
        //设置label的宽高
        titleLabel?.wigth = wigth
        titleLabel?.height = height - wigth
        titleLabel?.y = wigth
        titleLabel?.x = 0
        titleLabel?.textAlignment = .center
        
        self.setTitleColor(UIColor.gray, for: .normal)
        titleLabel?.font = UIFont.systemFont(ofSize: 12)
    }

}
